package com.bdyc.service.springImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.bdyc.dao.UserMapper;
import com.bdyc.po.User;
import com.bdyc.service.spring.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	@Autowired(required=true)
	@Qualifier("userMapper")//如果没有名称默认按类型注入
	private UserMapper userMapper;
	
	public UserMapper getUserMapper() {
		return userMapper;
	}
	public void setUserMapper(UserMapper userMapper) {
		this.userMapper = userMapper;
	}

	public void add(User user) {
		userMapper.add(user);
	}

	public void update(User user) {
		userMapper.update(user);
	}

	public void del(Integer id) {
		userMapper.del(id);
	}

	public User findById(Integer id) {
		return userMapper.findById(id);
	}

	public List<User> findAll() {
		return userMapper.findAll();
	}

}
